import request from "@/utils/request.js";
// 下单
export const createOrder = (orderData) => {
	return request.post('/order/addOrder', orderData)
}
// 支付订单
export const payOrder = (orderNo) => {
	return request.post('/order/pay', {
		orderNo
	})
}
// 获取订单核销二维码
export const getOrderVerificationCode = (apptProductId) => {
	return request.get('/order/generateQRCode', {
		apptProductId
	}, {
		showLoading: false
	})
}
// 获取订单详情
export const getOrderDetails = (orderNo) => {
	return request.get('/order/getOrderDetails', {
		orderNo
	})
}
// 获取订单列表
export const getOrderList = (params) => {
	return request.get('/order/getOrderPage', params)
}
// 取消订单
export const cancelOrder = (orderNo) => {
	return request.post('/order/cancelOrder', {
		orderNo
	})
}
// 用户订单退款
export const userOrderRefund = (apptProductId) => {
	return request.post('/order/userOrderRefund', {
		apptProductId
	})
}
// 管理员订单退款
export const adminOrderRefund = (apptProductId) => {
	return request.post('/order/adminOrderRefund', {
		apptProductId
	})
}
// 订单二维码核销
export const verifyOrderQRCode = (qrCodeId, apptProductId) => {
	return request.post('/order/redemptionOrder', {
		qrCodeId,
		apptProductId
	})
}
// 获取核销记录

export const getVerificationRecords = (params) => {
	return request.get('/orderRedemptionLog/getOrderRedemptionLogPage', params)
}